<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .outer {
      width: 200px;
      height: 200px;
      background-color: gold;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .inner {
      width: 100px;
      height: 100px;
      background-color: skyblue;
    }
  </style>
  <script src="https://cdn.jsdelivr.net/npm/vue@2.7.10/dist/vue.js"></script>
</head>

<body>
  <div id="app">
    <button v-on:click="handle">点我</button>
    <button @click="handle">点我</button>

    <hr>
    <div class="outer" @click.once="outerClick">
      <div class="inner" @click.stop.once="innerClick"></div>
    </div>
    <hr>
    <button @click="fn">点我</button>
    <button @click="gn(1,2)">点我</button>
    <button @click="kn(1,2,$event)">点我</button>
  </div>
  <script>
    let vm = new Vue({
      el: "#app",
      data() {
        return {
          // handle(){
          //     console.log("handle...");
          // }
        }
      },
      methods: {
        handle() {
          console.log("handle...");
        },
        outerClick() {
          console.log("outerClick...");
        },
        innerClick() {
          console.log("innerClick...");
        },
        fn(e) {
          console.log("e:", e);
        },
        gn(a, b) {
          console.log(a, b);
        },
        kn(a, b, e) {
          // 和原生DOM中的事件对象是类似的
          console.log(a, b, e);
        }
      },
    });
  </script>

</body>

</html>